package visiopuce.DAO;

import java.math.BigDecimal;
import java.util.List;

import org.hibernate.Query;

import visiopuce.HibernateUtil;
import visiopuce.objets.ZoneTesteeBiomol;

public class ZoneTesteeBiomolDAOImpl extends GenericDAOImpl<ZoneTesteeBiomol, BigDecimal> implements ZoneTesteeBiomolDAO {

	/** Constructeur priv� */
	private ZoneTesteeBiomolDAOImpl() {
	}

	/** Instance unique non pr�initialis�e */
	private static ZoneTesteeBiomolDAOImpl INSTANCE = null;

	/** Point d'acc�s pour l'instance unique du singleton */
	public static ZoneTesteeBiomolDAO getInstance() {
		if (INSTANCE == null) {
			INSTANCE = new ZoneTesteeBiomolDAOImpl();
		}
		return INSTANCE;
	}

	@Override
	public List<ZoneTesteeBiomol> getZoneTesteeBiomolByVerif(int idVerifBiomol) {
		List<ZoneTesteeBiomol> ztbm = null;
		String sql = "SELECT e FROM ZoneTesteeBiomol e WHERE e.verifBiomol.idVerifBioMol = :idVerifBiomol order by e.debut ASC";
		Query query = HibernateUtil.getSession().createQuery(sql).setParameter("idVerifBiomol", idVerifBiomol);
		ztbm = findMany(query);
		return ztbm;
	}

}